<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href='<?php echo base_url()?>'>
<link rel="stylesheet" type="text/css" href="public/common/css/common.css"/>
<link rel="stylesheet" type="text/css" href="public/admin/css/admin.css"/>
<script src="public/common/js/jquery.js"></script>
<script src="public/common/js/plug/wbox/wbox-min.js"></script>
<link rel="stylesheet" type="text/css" href="public/common/js/plug/wbox/wbox/wbox.css" />
<script>
$(function(){
	$("#image_frame").wBox({
		requestType: "iframe",
		title: "图片管理",
		target:"<?php echo site_url('admin/image/box_show')?>",
		iframeWH:{width:800,height:400}
	});
	$('select[name="category_id"]').val("<?php echo $ad->ad_pid?>");
});
</script>
</head>
<body>
	<div class="body">
    	<div class="main_top"><div class="position left">当前位置 <span>&gt;</span> 设置 <span>&gt;</span> 广告设置 <span>&gt;</span> 管理广告 <span>&gt;</span> 修改广告 </div></div>
    	<div class="body_center">
		<form action="<?php echo site_url('admin/ad/edit_ad/'.$ad->ad_id)?>" method=post>
            <table class="table">
            	<tr><th>参数名</th><th>参数值</th><th>参数说明</th></tr>
               	<tr><td class="right">广告分类：</td><td>
              	<select style="width:200px" name='category_id'>
					<?php foreach($category->result() as $value):?>
					<option value="<?php echo $value->category_id?>"><?php echo $value->category_name?></option>
					<?php endforeach;?>
                </select>
                </td><td><span class="red">*</span> 请选择广告所属分类</td></tr>
               	<tr><td class="right" style="line-height:100px;">图片地址：</td><td><input type="text" class='input_txt left' id='pic_path' name='ad_img' value="<?php echo $ad->ad_img?>"><a id="image_frame" href="<?php echo site_url('admin/picture/box_show')?>" class="left">上传图片</a></td><td id='show_pic_path'><img src="public/common/images/no_pic.gif"  width="100px" height="100px" /></td></tr>
                <tr><td class="right">链接地址：</td><td><input type="text" class="input_txt" value="<?php echo $ad->ad_link?>" name='ad_link'></td><td><span class="red">*</span> 请选择广告所属分类</td></tr>
                <tr><td class="right">图片描述：</td><td><input type="text" name='ad_desc' class="input_txt" value="<?php echo $ad->ad_desc?>"></td><td><span class="red">*</span> 请选择广告所属分类</td></tr>
                <tr><td class="right">图片排序：</td><td><input type="text" value="<?php echo $ad->ad_sort?>" name='ad_sort'></td><td><span class="red">*</span> 请选择广告所属分类</td></tr>
                <tr><td align="center" colspan="2"><input type="submit" name="submit" class="submit" value="提交" /> &nbsp;&nbsp;<input type="reset" name="reset" class="reset" value="重置" /></td><td>&nbsp;</td></tr>                
            </table>
			</form>
        </div>
    </div>
</body>
</html>